package com.spark.Service.impl;

import com.spark.Service.UserService;
import com.spark.mapper.UserMapper;
import com.spark.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author zhouqichun
 * @version 1.0
 * @date 2021/8/6 - 08 - 06 - 16:01
 * @description diary com.spark.Service.impl
 */
@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User getLoginUser(String username, String password) {
        return userMapper.getLoginUser(username, password);
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public int getUserCount() {
        return userMapper.getUserCount();
    }

    @Override
    public User getUserById(int id) {
        return userMapper.getUserById(id);
    }

    @Override
    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }
}
